Skip to content

Prepare to include cluster UID in CONTROLLER_IDENTITY to prevent cross-cluster conflicts#308

Merged
carlydf merged 16 commits intomainfrom
prepare-for-id-change
Apr 28, 2026
Merged

Prepare to include cluster UID in CONTROLLER_IDENTITY to prevent cross-cluster conflicts#308
carlydf merged 16 commits intomainfrom
prepare-for-id-change

Conversation

@carlydf
Copy link
Copy Markdown
Collaborator

@carlydf carlydf commented Apr 28, 2026

What was changed

In shouldClaimManagerIdentity, detect future format of manager identity

Why?

To facilitate clean reclaim after rollback from the next release, which will include #309

Checklist

  1. Closes

  2. How was this tested:
    Envtest won't test our get ns permissions, so just trusting there (we will test it in CI env because it runs on controller startup)

  3. Any docs updates needed?

carlydf and others added 15 commits April 27, 2026 13:46
Controllers that previously set ManagerIdentity as "release/namespace"
(pre-cluster-UID) or "temporal-worker-controller" (pre-Helm default)
would be permanently blocked from managing existing Worker Deployments
after upgrading, since shouldClaimManagerIdentity only triggered on
empty identity.

Now reclaims in both migration cases:
- exact match on the old hardcoded default
- new identity is a longer slash-prefixed version of the existing one

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… distinct test identity

- defaults.ControllerIdentity is now DeprecatedDefaultControllerIdentity to make
  clear it exists only for upgrade migration detection, not as a live default
- integration tests use a dedicated testControllerIdentity constant so they
  exercise the normal identity path rather than accidentally triggering the
  deprecated-identity migration branch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SetManagerIdentity with an empty identity clears the ManagerIdentity
field on the Worker Deployment, leaving it ownerless. Add an explicit
check and return an error rather than making the call. The startup
check in main() is the primary enforcement; this is a targeted guard
for the one call site where an empty value is actively dangerous.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@carlydf carlydf marked this pull request as ready for review April 28, 2026 17:00
@carlydf carlydf requested review from a team and jlegrone as code owners April 28, 2026 17:00
Copy link
Copy Markdown
Contributor

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@carlydf carlydf merged commit 02e0483 into main Apr 28, 2026
20 of 21 checks passed
@carlydf carlydf deleted the prepare-for-id-change branch April 28, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants